]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: respect "center" alignment of keys
authorDaiki Ueno <ueno@unixuser.org>
Mon, 20 Aug 2012 03:22:37 +0000 (12:22 +0900)
committerDaiki Ueno <ueno@unixuser.org>
Fri, 15 Feb 2013 03:27:43 +0000 (12:27 +0900)
https://bugzilla.gnome.org/show_bug.cgi?id=679925

js/ui/keyboard.js

index 928d265c1922cc66d5e153f4791856e4bf0f7940..b77170f6b85f4f7851bb33cf5612dd483233a216 100644 (file)
@@ -302,18 +302,27 @@ const Keyboard = new Lang.Class({
         let keyboard_row = new St.BoxLayout();
         for (let i = 0; i < keys.length; ++i) {
             let children = keys[i].get_children();
-            let right_box = new St.BoxLayout({ style_class: 'keyboard-row' });
             let left_box = new St.BoxLayout({ style_class: 'keyboard-row' });
+            let center_box = new St.BoxLayout({ style_class: 'keyboard-row' });
+            let right_box = new St.BoxLayout({ style_class: 'keyboard-row' });
             for (let j = 0; j < children.length; ++j) {
                 if (this._numOfHorizKeys == 0)
                     this._numOfHorizKeys = children.length;
                 let key = children[j];
                 let button = new Key(key);
 
-                if (key.align == 'right')
+                switch (key.align) {
+                case 'right':
                     right_box.add(button.actor);
-                else
+                    break;
+                case 'center':
+                    center_box.add(button.actor);
+                    break;
+                case 'left':
+                default:
                     left_box.add(button.actor);
+                    break;
+                }
                 if (key.name == 'Caribou_Prefs') {
                     key.connect('key-released', Lang.bind(this, this.hide));
                 }
@@ -332,6 +341,7 @@ const Keyboard = new Lang.Class({
                 }));
             }
             keyboard_row.add(left_box, { expand: true, x_fill: false, x_align: St.Align.START });
+            keyboard_row.add(center_box, { expand: true, x_fill: false, x_align: St.Align.MIDDLE });
             keyboard_row.add(right_box, { expand: true, x_fill: false, x_align: St.Align.END });
         }
         layout.add(keyboard_row);